Mark Read Notification
The markReadNotification()
function is used to mark a notification as read. It takes a MarkReadNotificationRequest
as input and returns a MarkReadNotificationResponse
as a Future.
Steps to Mark a Notification as Read
Build a
MarkReadNotificationRequest
object using theMarkReadNotificationRequestBuilder
class.Call the
markReadNotification()
function using the instance of theLMFeedClient
class.Use the response as per your requirement.
// Build the request object
MarkReadNotificationRequest markReadNotificationRequest = (MarkReadNotificationRequestBuilder()
..activityId("your_activity_id_here"))
.build();
// Get the response from calling the function
final MarkReadNotificationResponse markReadNotificationResponse = await lmFeedClient.markReadNotification(markReadNotificationRequest);
// Process the response, as per requirement
if(markReadNotificationResponse.success){
// your function to handle successful marking of notification as read
handleMarkReadNotificationSuccess();
}else{
// your function to handle error message
handleMarkReadNotificationError(markReadNotificationResponse.errorMessage);
}
Models
MarkReadNotificationRequest
List of parameters for the MarkReadNotificationRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
activityId | String | ID of the notification activity to mark as read |
MarkReadNotificationResponse
List of parameters for the MarkReadNotificationResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in case of failure | ✔ |